Skip to content

feat: add a pace indicator to the usage bars#25

Open
carlosresu wants to merge 3 commits into
CodeZeno:mainfrom
carlosresu:feat/pace-indicator
Open

feat: add a pace indicator to the usage bars#25
carlosresu wants to merge 3 commits into
CodeZeno:mainfrom
carlosresu:feat/pace-indicator

Conversation

@carlosresu
Copy link
Copy Markdown

@carlosresu carlosresu commented May 15, 2026

Summary

Adds an opt-in pace indicator that marks where usage should be if it were spread evenly across the window, so each bar shows at a glance whether the current burn rate is ahead of or behind pace.

  • The expected position is derived from each section's resets_at timestamp and the fixed window length (5h or 7d).
  • Drawn red when actual usage is ahead of pace, green when behind.
  • Two styles:
    • Tick — a thin vertical bar at the expected-pace position.
    • Solid — a filled band spanning the gap between actual usage and the expected-pace position.

Settings control

A single right-click Settings entry drives it:

  • Show pace indicator — a submenu whose Off (default) / Tick / Solid items form a radio group.
  • Selecting Tick or Solid turns the indicator on with that style; selecting Off turns it off.
  • The parent Show pace indicator entry shows a checkmark while a style is active and is cleared when Off is selected.

The indicator is off by default. State persists to settings.json via #[serde(default)] fields, so existing settings files migrate cleanly. The indicator is drawn inside the existing bar segments, so the widget width is unchanged.

Localization

All menu strings (Show pace indicator, Off (default), Tick, Solid) are translated across all eight supported locales.

Commits

  • feat: add pace indicator localization
  • feat: add a pace indicator to the usage bars
  • refactor: make the pace indicator a single Off/Tick/Solid submenu

Test plan

  • Build the release binary and run it
  • Right-click → Settings → Show pace indicator; confirm the submenu lists Off (default), Tick, Solid
  • Select Tick, then Solid; confirm the indicator appears on the 5h and 7d bars and updates live, and the parent entry shows a checkmark
  • Confirm the indicator is red when usage is ahead of pace and green when behind
  • Select Off; confirm the indicator disappears, the bars render exactly as before, and the parent entry's checkmark is cleared
  • Restart the app; confirm the selected style (or Off) persists
  • Verify the widget width is unchanged whether the indicator is on or off

Adds the pace indicator strings to the Strings struct and provides
translations for all eight supported locales: the show_pace_indicator
menu item, the pace_indicator_style submenu label, and the Tick and
Solid style names. The strings are wired into the renderer and the
right-click menu in the following commit.
Adds an opt-in pace indicator that marks where usage should be if it
were spread evenly across the window, so the bar shows whether the
current burn rate is ahead of or behind pace.

The expected position is derived from each section's resets_at
timestamp and the fixed window length (5h or 7d). It is drawn red when
actual usage is ahead of pace and green when behind, in one of two
styles:

  - Tick: a thin vertical bar at the expected-pace position.
  - Solid: a filled band spanning the gap between actual usage and the
    expected-pace position.

Two right-click Settings controls drive it: a 'Show pace indicator'
checkbox (off by default) and a 'Pace indicator style' submenu with
Tick and Solid options (Solid by default). Both persist to
settings.json via #[serde(default)] fields so existing files migrate
cleanly. The indicator is drawn inside the existing bar segments, so
the widget width is unchanged.
"Show pace indicator" becomes a submenu whose Off, Tick, and Solid items
form a radio group. The parent entry shows a check while a style is
active; selecting Off clears it and turns the indicator off. This
replaces the separate "Show pace indicator" checkbox and "Pace indicator
style" submenu with a single settings entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant